package main

import (
	"net/http"
	"server/uploader"
)

func main() {
	directUploader := uploader.NewDirectUploader(FileTargetPath)
	http.HandleFunc("/direct-upload", directUploader.HandleUpload)

	fragmentUploader := uploader.NewFragmentUploader(FileTmpPath, FileTargetPath)
	http.HandleFunc("/prepare-upload", fragmentUploader.HandlePrepare)
	http.HandleFunc("/upload-slice", fragmentUploader.HandleUpload)
	http.HandleFunc("/upload-finished", fragmentUploader.HandleFinished)

	_ = http.ListenAndServe("localhost:8081", nil)
}
